//
//  ViewController.m
//  qwer
//
//  Created by mac on 16-4-19.
//  Copyright (c) 2016年 lhg. All rights reserved.
//

#import "ViewController.h"

@interface ViewController ()
{
    NSArray *hehe;
    
    
}
@end

@implementation ViewController

- (void)viewDidLoad
{
    [super viewDidLoad];
	// Do any additional setup after loading the view, typically from a nib.
    self.view.backgroundColor =[UIColor blueColor];
    hehe =@[ @"科比",
             @"奥巴马",
             @"马云",
             @"王健林 ",
             @"扎克伯格",
             @"艾米纳姆",
             ];
    
    UITableView *tableView = [[UITableView alloc]initWithFrame:self.view.bounds style:UITableViewStylePlain];
    
    tableView.dataSource = self;
    [self.view addSubview:tableView];
    
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return hehe.count;
    
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell =[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil];
    cell.textLabel.text =hehe[indexPath.row];
    return cell;
    
    
}



- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
